package cn.edu.cug.cs.gtl.docsrv.config;

import cn.edu.cug.cs.gtl.mybatis.Session;
import cn.edu.cug.cs.gtl.mybatis.mapper.auth.AuthUser;
import cn.edu.cug.cs.gtl.mybatis.mapper.dict.DictDataSource;
import cn.edu.cug.cs.gtl.mybatis.mapper.auth.Authority;
public class Configuration {


    private static Authority currentAuthority;
    private static FTPConfig ftpConfig;
    private static HDFSConfig hdfsConfig;
    private static ManagerConfig managerConfig;

    public static ManagerConfig getManagerConfig() {
        return managerConfig;
    }

    public static void setManagerConfig(ManagerConfig managerConfig) {
        Configuration.managerConfig = managerConfig;
    }

    public static HDFSConfig getHdfsConfig() {
        return hdfsConfig;
    }

    public static void setHdfsConfig(HDFSConfig hdfsConfig) {
        Configuration.hdfsConfig = hdfsConfig;
    }

    public static Session getSession(){
        return Session.getMasterSession();
    }

    public static Session getMasterSession(){
        return getSession();
    }

    public static Session getSlaveSession(String dataSourceName){
        return  getSession();
    }

    public static Session getSlaveSession(DictDataSource dataSource){
        return  getSession();
    }

    public static void setFtpConfig(FTPConfig config){
        ftpConfig = config;
    }

    public static FTPConfig getFtpConfig(){
        return ftpConfig;
    }

    public static Authority getAuthority() {
        return currentAuthority;
    }

    public static void setAuthority(Authority currentAuthority) {
        Configuration.currentAuthority = currentAuthority;
    }
}
